import VueRouter from 'vue-router'
// 导入路由组件
import Home from './components/tabbars/Home.vue'
import Member from './components/tabbars/Member.vue'
import Search from './components/tabbars/Search.vue'
import Shopcar from './components/tabbars/Shopcar.vue'
import NewsList from './components/news/NewsList.vue'
import Newsinfo from './components/news/Newsinfo.vue'
import ImgList from './components/photo/ImgList.vue'
import PhotoInfo from './components/photo/PhotoInfo.vue'
import GoodsList from './components/goods/GoodsList.vue'
import GoodsInfo from './components/goods/GoodsInfo.vue'
import GoodsDesc from './components/goods/GoodsDesc.vue'
import GoodsComment from './components/goods/GoodsComment.vue'

//创建路由对象
const router = new VueRouter({
  routes: [
    {
        path:'/',redirect:'/home'
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/member',
      component: Member
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/shopcar',
      component: Shopcar
    },
    {
        path:'/home/newslist',
        component:NewsList
    },
    {
        path:'/home/newsinfo/:id',
        component:Newsinfo,
        props:true
    },
    {
        path:'/home/imglist',
        component:ImgList
    },
    {
      path:'/home/photoinfo/:id',
      component:PhotoInfo,
      props:true
     
    },
    {
      path:'/home/goodslist',
      component:GoodsList
    },
    {
      path:'/home/goodslist/:id',
      component:GoodsInfo,
      props:true
    },
    {
      path:'/home/goodsdesc/:id',
      component:GoodsDesc,
      props:true
    },{
      path:'/home/GoodsComment/:id',
      component:GoodsComment,
      props:true
    }

  ],
  linkActiveClass:'mui-active' //手动设置被激活的路由连接的高亮样式
})

export default router